package com.lh.controller;

import com.lh.commonutils.R;
import com.lh.entity.RolePermission;
import com.lh.service.RolePermissionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YMS
 * @date 2021/6/16
 */
@RestController
@RequestMapping("/admin/acl/rolepermission")
public class RolePermissonController {

    @Autowired
    private RolePermissionService rolePermissionService;


    @ApiOperation(value = "新增hhhh")
    @PostMapping("add")
    public R add(@RequestBody RolePermission permission){
        boolean save = rolePermissionService.save(permission);
        if (save){
            return R.ok();
        }
        return R.error();

    }
}
